package co.baiku.boot.jpush;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 推送参数封装
 **/
public class JPushRequest {
    /**
     * 标题
     */
    private String title;
    /**
     * sub标题
     */
    private String subTitle;
    /**
     * 内容
     */
    private String content;
    /**
     * 发送范围: 唯一标识:alias,全部:all
     */
    private String scope;
    /**
     * 唯一标识:registrationId 发送不能超过1000个
     */
    private List<String> registrationId;
    /**
     * 自定义参数
     */
    private Map<String, String> extras = new HashMap<>();


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSubTitle() {
        return subTitle;
    }

    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    public String getContent() {
        if (StringUtils.isEmpty(content)) {
            return " ";
        }
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }


    public Map<String, String> getExtras() {
        return extras;
    }

    public void setExtras(Map<String, String> extras) {
        this.extras = extras;
    }

    public List<String> getRegistrationId() {
        return registrationId;
    }

    public void setRegistrationId(List<String> registrationId) {
        this.registrationId = registrationId;
    }

    public void addExtras(String key, String value) {
        extras.put(key, value);
    }
}
